#include "addconnectdialog.h"
#include "ui_addconnectdialog.h"
#include <QDebug>;

AddConnectDialog::AddConnectDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddConnectDialog)
{
    ui->setupUi(this);
}

AddConnectDialog::~AddConnectDialog()
{
    delete ui;
}

void AddConnectDialog::on_addButton_clicked()
{
    qDebug() << "add button pressed.";
    CLoginCfgMgr::TConnectItem item;
    item.m_name = ui->nameEdit->text();
    item.m_ip = ui->ipEdit->text();
    item.m_user = ui->userEdit->text();
    item.m_passwd = ui->passwdEdit->text();

    CLoginCfgMgr::singleton()->addConnectItem(item);
    CLoginCfgMgr::singleton()->refresh();
    this->done(0);
}
